//
//  LSZSupportMeasuresViewController.m
//  PartyClassCloud
//
//  Created by 梁素珍 on 2018/11/30.
//  Copyright © 2018年 九酷. All rights reserved.
//

#import "LSZSupportMeasuresViewController.h"

@interface LSZSupportMeasuresViewController ()<UITableViewDataSource,UITableViewDelegate>
@property(nonatomic,strong) UITableView * tableViewSupportMeasures;
@property(nonatomic,strong) NSArray * arrayTitleArray;
@end

@implementation LSZSupportMeasuresViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    self.title = @"帮扶措施";
    self.arrayTitleArray = @[@"开始时间",@"结束时间",@"产业扶贫",@"产业扶贫内容",@"教育扶贫",@"教育扶贫内容",@"社会救助",@"社会救助措施内容",@"市级政策",@"市级政策措施内容",@"县级政策",@"县级政策措施内容",@"卫生扶贫",@"卫生扶贫措施内容",@"转移就业",@"转移就业措施内容",@"金融扶贫",@"金融扶贫措施内容"];
    [self.tableViewSupportMeasures registerNib:[UINib nibWithNibName:@"LSZOrSoTableViewCell" bundle:nil] forCellReuseIdentifier:@"LSZOrSoTableViewCell"];
}
- (NSInteger)tableView:(nonnull UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
    return self.arrayTitleArray.count;
}
-(CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath
{
    return 45;
}
-(CGFloat)tableView:(UITableView *)tableView heightForFooterInSection:(NSInteger)section
{
    return 0.001;
}
-(CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section
{
    return 0.001;
}
-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
    LSZOrSoTableViewCell * cell = [tableView dequeueReusableCellWithIdentifier:@"LSZOrSoTableViewCell" forIndexPath:indexPath];
    cell.leftLabel.text = self.arrayTitleArray[indexPath.row];
    switch (indexPath.row) {
        case  0:
            {
                cell.rightBut.text = self.inquiryPoorHouseholdsMg.antiStart;
            }
            break;
        case  1:
        {
            cell.rightBut.text = self.inquiryPoorHouseholdsMg.antiEnd;
        }
            break;
        case  2:
        {
            if([self.inquiryPoorHouseholdsMg.industry isEqualToString:@"false"] ){
                cell.rightBut.text = @"无";
            }else{
                cell.rightBut.text = self.inquiryPoorHouseholdsMg.industry;
            }
        }
            break;
        case  3:
        {
            cell.rightBut.text = self.inquiryPoorHouseholdsMg.industryContent;

        }
            break;
        case  4:
        {
            if([self.inquiryPoorHouseholdsMg.education isEqualToString:@"false"] ){
                cell.rightBut.text = @"无";
            }else{
                cell.rightBut.text = self.inquiryPoorHouseholdsMg.education;
            }
        }
            break;
        case  5:
        {
            cell.rightBut.text = cell.rightBut.text = self.inquiryPoorHouseholdsMg.educationContent;

        }
            break;
        case  6:
        {
            if([self.inquiryPoorHouseholdsMg.difficult isEqualToString:@"false"] ){
                cell.rightBut.text = @"无";
            }else{
                cell.rightBut.text = self.inquiryPoorHouseholdsMg.difficult;
            }
        }
            break;
        case  7:
        {
            cell.rightBut.text =  cell.rightBut.text = self.inquiryPoorHouseholdsMg.socialContent;
        }
            break;
        case  8:
        {
            if([self.inquiryPoorHouseholdsMg.city isEqualToString:@"false"] ){
                cell.rightBut.text = @"无";
            }else{
                cell.rightBut.text = self.inquiryPoorHouseholdsMg.city;
            }
        }
            break;
        case  9:
        {
            cell.rightBut.text = self.inquiryPoorHouseholdsMg.cityContent;

        }
            break;
        case  10://县
        {
            if([self.inquiryPoorHouseholdsMg.county isEqualToString:@"false"] ){
                cell.rightBut.text = @"无";
            }else{
                cell.rightBut.text = self.inquiryPoorHouseholdsMg.county;
            }
            
        }
            break;
        case  11:
        {
            cell.rightBut.text = self.inquiryPoorHouseholdsMg.countyContent;

        }
            break;
        case  12://卫生
        {
            if([self.inquiryPoorHouseholdsMg.hygiene isEqualToString:@"false"] ){
                cell.rightBut.text = @"无";
            }else{
                cell.rightBut.text = self.inquiryPoorHouseholdsMg.hygiene;
            }
           
        }
            break;
        case  13:
        {
            cell.rightBut.text = self.inquiryPoorHouseholdsMg.hygieneContent;

        }
            break;
        case  14://就业
        {
            
            cell.rightBut.text = @"";
        }
            break;
        case  15:
        {
            cell.rightBut.text = @"";

        }
            break;
        case  16:
        {
            if([self.inquiryPoorHouseholdsMg.finance isEqualToString:@"false"] ){
                cell.rightBut.text = @"无";
            }else{
                cell.rightBut.text = self.inquiryPoorHouseholdsMg.finance;
            }

        }
            break;
        case  17:
        {
            cell.rightBut.text = self.inquiryPoorHouseholdsMg.financeContent;
         
        }
            break;
        default:
            break;
    }
    CGFloat width = [LSZSpecialPackaging getsTheAdaptiveWidth:cell.rightBut sizeMaxWidth:ScreenWidth/2];
    [cell.rightBut mas_updateConstraints:^(MASConstraintMaker *make) {
        make.width.mas_equalTo(width);
    }];
    cell.selectionStyle = UITableViewCellSelectionStyleNone;
    return cell;
}

-(UITableView *)tableViewSupportMeasures
{
    if (_tableViewSupportMeasures == nil) {
        _tableViewSupportMeasures = [[UITableView alloc]initWithFrame:CGRectMake(0, 0, [[UIScreen mainScreen] bounds].size.width , [[UIScreen mainScreen] bounds].size.height) style:UITableViewStyleGrouped];
        _tableViewSupportMeasures.delegate = self;
        _tableViewSupportMeasures.dataSource = self;
        _tableViewSupportMeasures.estimatedRowHeight=0;
        _tableViewSupportMeasures.estimatedSectionFooterHeight =0;
        _tableViewSupportMeasures.estimatedSectionHeaderHeight =0;
        [_tableViewSupportMeasures setSeparatorInset:UIEdgeInsetsMake(0, 20, 0, 20)];
        [self.view addSubview:_tableViewSupportMeasures];
    }
    return _tableViewSupportMeasures;
}
@end
